import request from '@/utils/request'
const baseUrl = '/cz-system/api/v1/users' //系统用户
// import {getRouters } from '@/api/user/index' 
const baseUrlOne = '/cz-system/api/v1/menus' 

/*
# 根据id查询用户详情
# GET {{baseUrl}}/users/{id}
Content-Type: {{contentType}}
Authorization:{{token}}
*/
export const getUserData = (id: number) => { 
  return request({
    url: baseUrl+'/'+id,
    method: 'GET'
  })
}

/*
# 管理员: 查询用户分页列表
# POST {{baseUrl}}/users/userSimpleList
# 过滤条件:  姓名:nickname  手机号:mobile 
*/
export const userSimpleList = (data: any) => { 
  return request({
    url: baseUrl+'/userSimpleList',
    method: 'POST',
    data:data
  })
}
/*
手机号验证码 
*/
export const updatePasswordCode = (data: any) => { 
  return request({
    url: baseUrl+'/updatePassword/sms_code',
    method: 'POST',
    params: data

  })
}
/*
游客注册
// POST {{baseUrl}}/users/tourist
// Content-Type: {{contentType}}
// Authorization:{{token}}
*/
export const registerTourist = (dataInfo: any) => {
  return request({
    url: baseUrl+'/tourist',
    method: 'POST',
    data: dataInfo
  })
}

/*
# 用户:根据用户Id查询菜单数据
# GET  {{baseUrl}}/users/{userId}/menuList
*/
export const getRouters = (userId: any) => {
  return request({
    url: baseUrlOne+'/'+userId+'/menuList',
    method: 'GET'
  })
}

/*
修改密码
*/
export const updatePassword = (data: any) => { 
  return request({
    url: baseUrl+'/updatePassword',
    method: 'put',
    data:data
  })
}